<?php

/**
 * 部门操作控制器（废弃可以删了）
 */

namespace app\api\controller;

use think\Db;
use app\common\controller\Common;

class Asrserver  extends Common
{
    public function list()
    {
        try {
            $param  = $this->param;
            $condition = !empty($param['condition']) ? $param['condition'] : '';
            $keyword = !empty($param['keyword']) ? $param['keyword'] : '';
            $page = !empty($param['page']) ? $param['page'] : '1';
            $limit = !empty($param['limit']) ? $param['limit'] : '10';
            $asr_model = Model('Asrserver');
            $data = $asr_model->getList($condition, $keyword, $page, $limit);
            return resultArray(['data' => $data]);
        } catch (\Exception $e) {
            return resultArray(['error' => $e->getMessage()]);
        }
    }

    public function create()
    {
        $param = input('param.');
        $param['create_time'] = time();
        $param['update_time'] = time();
        $asr_model = Model('Asrserver');
        $result = $asr_model->createData($param);
        if (!$result) {
            return resultArray(['error' => $asr_model->getError()]);
        }
        return resultArray(['data' => '']);
    }

    public function edit()
    { }

    public function delete()
    { }

    public function enable()
    { }
}
